";
$rchs_dtls=explode(",",$bzv1_rchs);
if($sw== 0)
{
$sw=1;
echo "";
foreach($rchs_dtls as $rchs_key => $rchs_val)
{
$gram_rslt=gram_rule($rchs_val,$line_val,$invr_taal);
// print_r($gram_rslt);
foreach($gram_rslt as $gram_key => $gram_val)
{
$gram_dtls=explode("!!",$gram_val);
// echo "".$line_val." | ".$gram_key." | ".$gram_dtls[0]." |
";
}
// echo "".$bzv1_lnks." | ".$rchs_val." |
";
}
}
// print_r($rchs_dtls);
$bzv1_datm=$chbt_itms[5];
$bzv1_levl=$chbt_itms[6];
$bzv1_url=$chbt_itms[7];
$cmds_bzv2=$line_val."!!".$smts_tlkd."[sgmt[".$invr_taal."[".$spec_conc."[".substr($invr_lgrm,0,64)."[".$vr;
// echo "
SMTA INVR BZV2 ".$cmds_bzv2;
// include ("chbt-cmds-code-2.php");
}
}
}
}
if (count($line_dtls) > 1)
{
$spec_rslt=bepl_spec($invr_lgrm);
/// echo "
SMTS TEXT ".$smts_text;
$spec_dtls=explode(">",$spec_rslt);
foreach($spec_dtls as $spec_key => $spec_val)
{
$spec_dtls=explode("!!",$spec_val);
echo "".$spec_dtls[0]." | ".$spec_dtls[1]." |
";
// echo "".$spec_val." |
";
}
// print_r($spec_dtls);
foreach($spec_dtls as $spec_key => $spec_val)
{
// echo "
".$spec_dtls[0]."".$spec_dtls[1];
if ($spec_val != $spec_rslt)
{
$spec_dtls[1]=trim($spec_dtls[1]);
if (count($spec_dtls) > 1 and $spec_val != null and $spec_dtls[1] != null)
{
$spec_conc=str_replace("!!","",$spec_dtls[1]);
// echo "
".$spec_dtls[0]."".$spec_dtls[1];
}
}
}
echo "".$invr_lgrm."
";
$smts_rslt=tlkd_smts($invr_lgrm);
// print_r($smts_rslt);
$sw=0;
foreach($smts_rslt as $smts_key => $smts_val)
{
$smts_dtls=explode("!!",$smts_key);
$smts_text=$smts_dtls[0];
$smts_tlkd=$smts_dtls[1];
$smts_posn=$smts_dtls[2];
if ($sw== 0)
{
$sw=1;
echo "
FIRST ".$smts_text;
}
$text_itms=explode(" ",$smts_text);
if ($smts_posn == 0)
{
$psmts_text = $smts_text."-";
}
if ($smts_posn == 50)
{
$psmts_text = "-".$smts_text."-";
}
if ($smts_posn == 99)
{
$psmts_text = "-".$smts_text;
}
if (count($text_itms) == 2)
{
$spec_rslt=bepl_spec(" ".$smts_text." ");
$spec_dtls=explode("!!",$spec_rslt);
// echo "
SPEC RSLT ".$spec_rslt;
foreach($spec_dtls as $spec_key => $spec_val)
{
if ($psmts_text != $srelt)
{
$spec_dtls[1]=trim($spec_dtls[1]);
// $spec_conc=str_replace("-","",$spec_dtls[1]);
// echo "
".$spec_dtls[0]."--".$spec_dtls[1];
$conc_rslt=$spec_dtls[1];
if ($conc_rslt !=null)
{
$two_rslt[$conc_rslt]=$two_rslt[$conc_rslt]+1;
// echo "
TEXT ".$psmts_text." TWO ".$spec_dtls[0]."--".$spec_dtls[1];
}
$srelt=$psmts_text;
}
}
}
if (count($text_itms) > 2)
{
if ($prelt != $psmts_text)
{
$prelt=$psmts_text;
$cmds_ipad=$invr_corp;
$spec_rslt=bepl_spec($smts_text);
// echo "
SMTS TEXT ".$psmts_text;
// echo "
SEMANTA Interpretatie ".$spec_rslt;
$spec_dtls=explode("!!",$spec_rslt);
// print_r($spec_dtls);
foreach($spec_dtls as $spec_key => $spec_val)
{
if ($spec_val != $spec_rslt)
{
$spec_dtls[1]=trim($spec_dtls[1]);
if (count($spec_dtls) > 1 and $spec_val != null and $spec_dtls[1] != null)
{
$spec_conc=str_replace("-","",$spec_dtls[1]);
$conc_rslt=$spec_dtls[1];
$three_rslt[$conc_rslt]=$three_rslt[$conc_rslt]+1;
// echo "
TEXT ".$psmts_text." THREE ".$spec_dtls[0]."--".$spec_dtls[1];
}
}
}
}
if ($spec_conc == null)
{
$spec_conc="onderwerp";
}
$cmds_bzv2=$psmts_text."!!".$smts_tlkd."[sgmt[".$invr_taal."[".$spec_conc."[".substr($invr_lgrm,0,64)."[".$vr;
// echo "
SMTA INVR BZV2 ".$cmds_bzv2;
include ("chbt-cmds-code-2.php");
$vr=$vr+1;
$asmts_text=str_replace("-","*",$psmts_text);
$asmts_text=str_replace(" ","+",$asmts_text);
$sinvr_lgrm=str_replace(" ","+",$invr_lgrm);
// echo "
PSMTS TEXT ".$psmts_text." ASMTS TEXT ".$asmts_text;
$lsmts_text="".$psmts_text."";
echo "".$spec_val." | ".$lsmts_text." |
";
}
}
}
}
echo "
";
echo "
END ".$psmts_text;
if (count($zero_rslt) > 0)
{
echo "
ZERO RESULT";
ksort($zero_rslt);
print_r($zero_rslt_rslt);
}
if (count($two_rslt) > 0)
{
echo "
TWO RESULT";
ksort($two_rslt);
print_r($two_rslt);
}
if (count($three_rslt) > 0)
{
echo "
THREE RESULT";
ksort($three_rslt);
print_r($three_rslt);
}
//////////////////
// echo "
INVR LGRM ".$invr_lgrm;
$spec_rslt=bepl_spec($invr_lgrm);
$bzv1_rslt=xtrt_xxxx($invr_lgrm,$invr_taal,"data",24);
// print_r($bzv1_rslt);
foreach($bzv1_rslt as $bzv1_key => $bzv1_val)
{
$chbt_itms=explode("!!",$bzv1_key);
// print_r($chbt_itms);
$bzv1_taal=$chbt_itms[1];
$bzv1_scre=$chbt_itms[0];
$bzv1_taal=$chbt_itms[1];
$bzv1_corp=$chbt_itms[2];
//echo "
INVR CORP ".$invr_corp." CHBT CORP ".$chbt_corp;
$corp_array[$chbt_key]=$corp_array[$chbt_key]+1;
if ($invr_corp == $chbt_corp)
{
// $corp_array[$chbt_key]=$corp_array[$chbt_key]+1;
}
$schbt_corp=str_replace(" ","+",$chbt_corp);
$bzv1_lnks=$chbt_itms[3];
$bzv1_rchs=$chbt_itms[4];
$bzv1_datm=$chbt_itms[5];
$bzv1_levl=$chbt_itms[6];
$bzv1_url=$chbt_itms[7];
if (strlen($invr_lgrm) < 64 and $rrelt != $bzv1_rchs)
{
$sim = similar_text($invr_lgrm, $bzv1_rchs, $perc);
if ($perc > 1)
{
// echo "
PERC ".round($perc, 2);
// echo " SCORE ".$bzv1_scre." ".$bzv1_lnks;
$rrelt=$bzv1_rchs;
}
}
}
echo "";
$chbt_rslt=xtrt_xxxx($invr_lgrm,$invr_taal,"base");
if (count($chbt_rslt) > 1)
{
echo "Taal | Gesprekspartner | Kennisdomein | Corpus |
Website";
foreach($chbt_rslt as $chbt_key => $chbt_val)
{
$chbt_itms=explode("!!",$chbt_key);
// print_r($chbt_itms);
$chbt_taal=$chbt_itms[1];
$chbt_scre=$chbt_itms[0];
$chbt_taal=$chbt_itms[1];
$chbt_corp=$chbt_itms[2];
//echo "
INVR CORP ".$invr_corp." CHBT CORP ".$chbt_corp;
$corp_array[$chbt_key]=$corp_array[$chbt_key]+1;
if ($invr_corp == $chbt_corp)
{
// $corp_array[$chbt_key]=$corp_array[$chbt_key]+1;
}
$schbt_corp=str_replace(" ","+",$chbt_corp);
$chbt_lnks=$chbt_itms[3];
$chbt_rchs=$chbt_itms[4];
$chbt_datm=$chbt_itms[5];
$chbt_levl=$chbt_itms[6];
$chbt_url=$chbt_itms[7];
echo "
".$chbt_taal." | ".$chbt_corp." | ".$chbt_lnks." | ".$chbt_rchs." | ".$chbt_url." |
";
}
echo "
";
}
if ($invr_tabl== null)
{
$invr_tabl="base";
}
//echo "
INVR TABL ".$invr_tabl;
$omsc_rslt=xtrt_xxxx($invr_tabl,$invr_taal,"omsc");
// print_r($omsc_rslt);
foreach($omsc_rslt as $omsc_key => $omsc_val)
{
$omsc_itms=explode("!!",$omsc_key);
$omsc_text=$omsc_itms[4];
echo "
We gaan zoeken in ".$omsc_text;
}
///////////
$lgrm_lngt=strlen($invr_lgrm);
$mtph_lngt=($lgrm_lngt/4)+2;
echo round($mtph_lngt,0, PHP_ROUND_HALF_UP);
$mtph_lgrm=metaphone ($invr_lgrm,$mtph_lngt);
// echo "
INVR LGRM ".$invr_lgrm."LGRM LNGT ".$lgrm_lngt." MTPN LNGT ".$mtph_lngt." MTPN LGRM ".$mtph_lgrm;
///////////
if ($invr_lgrm== null)
{
$invr_lgrm="Wat doet semanta voor mij";
}
$summ_lgrm="";
if ($invr_lgrm != null)
{
$lgrm_dtls=str_replace("+"," ",$invr_lgrm);
// echo "
Wat kregen we binnen TAAL ".$invr_taal. " CHBT ".$invr_chbt." MAIL ".$invr_mail." BZV1".$invr_bzv1." PWRD ".$invr_pwrd." IPAD ".$invr_ipad." TABL ".$invr_tabl." LGRM ".$invr_lgrm." CORP ".$invr_corpm;
$lgrm_dtls=explode(" ",$invr_lgrm);
// print_r($lgrm_dtls);
if (count($lgrm_dtls) > 2)
{
// echo "Zinsanalyse";
$sinvr_bzv1=str_replace(" ","+",$invr_lgrm);
$summ_lgrm=$summ_lgrm." ".$lgrm_val;
?>
&pwrd= echo $invr_pwrd; ?>&bzv1= echo $sinvr_bzv1; ?>> echo $invr_lgrm; ?>
}
echo " |
";
if (count($lgrm_dtls) > 1)
{
// echo "Losse woorden ";
foreach($lgrm_dtls as $lgrm_key => $lgrm_val)
{
if (strlen($lgrm_val) > 3)
{
$summ_lgrm=$summ_lgrm." ".$lgrm_val;
?>
&pwrd= echo $invr_pwrd; ?>&rchs= echo $lgrm_val; ?>>- echo $lgrm_val; ?>
}
}
echo " |
";
}
}
$sinvr_bzv1=str_replace(" ","+",$summ_lgrm);
$srch_tabl="base,lpzg,sgmt";
$srch_dtls=explode(",",$srch_tabl);
echo "";
foreach($srch_dtls as $srch_key => $srch_val)
{
$invr_tabl=$srch_val;
$chbt_rslt=xtrt_xxxx($invr_lgrm,$invr_taal,$invr_tabl);
// print_r($chbt_rslt);
if(count($chbt_rslt) == 0)
{
// echo "Semanta heeft geen zoekwoord ".$invr_lgrm." gevonden in het zoekgebied van ".$srch_val." |
";
}
if(count($chbt_rslt) > 0)
{
// echo "Semanta heeft het zoekwoord ".$invr_lgrm." gevonden in ".count($chbt_rslt)." relaties met ".$srch_val." waarvan er max 4 worden getoond |
";
$sinvr_lgrm=str_replace(" ","+",$invr_lgrm);
echo "";
// print_r($chbt_rslt);
//echo "Kennisdomein | Website | | chatbot | | Corpus |
";
$cn=0;
// echo "
Wat kregen we binnen TAAL ".$invr_taal. " CHBT ".$invr_chbt." MAIL ".$invr_mail." BZV1".$invr_bzv1." PWRD ".$invr_pwrd." IPAD ".$invr_ipad." TABL ".$invr_tabl." LGRM ".$invr_lgrm;
$nb=0;
$nd=0;
$nw=0;
$nr=0;
$ns=0;
$nv=0;
// echo "
chbt KEY ". $chbt_key." chbt VAL ".$chbt_val;
foreach($chbt_rslt as $chbt_key =>$chbt_val)
{
$chbt_itms=explode("!!",$chbt_key);
// print_r($chbt_itms);
$chbt_taal=$chbt_itms[1];
$chbt_scre=$chbt_itms[0];
$chbt_taal=$chbt_itms[1];
$chbt_corp=$chbt_itms[2];
//echo "
INVR CORP ".$invr_corp." CHBT CORP ".$chbt_corp;
if ($invr_corp == $chbt_corp)
{
$corp_array[$chbt_key]=$corp_array[$chbt_key]+1;
}
$schbt_corp=str_replace(" ","+",$chbt_corp);
$chbt_lnks=$chbt_itms[3];
$chbt_rchs=$chbt_itms[4];
$schbt_rchs=str_replace(" ","+",$chbt_rchs);
$chbt_datm=$chbt_itms[5];
$chbt_levl=$chbt_itms[6];
$chbt_url=$chbt_itms[7];
// echo "
Wat kregen we binnen TAAL ".$invr_taal. " CHBT ".$invr_chbt." MAIL ".$invr_mail." BZV1".$invr_bzv1." PWRD ".$invr_pwrd." IPAD ".$invr_ipad." TABL ".$invr_tabl." LGRM ".$invr_lgrm;
if ($chbt_corp != "semanta")
{
$chbt_array[$chbt_corp."!!".$chbt_taal]=$chbt_array[$chbt_corp."!!".$chbt_taal]+1;
}
if ($invr_tabl == "wrtv")
{
if ($nw < 2)
{
$domn_array[$invr_tabl."@".$chbt_lnks]=$domn_array[$invr_tabl."@".$chbt_lnks]+1;
echo "
".$chbt_lnks." | ".$chbt_url." | | ".$chbt_corp. " | | ". $chbt_rchs." ".$lvgpt_indx." |
";
$nw=$nw+1;
}
}
if ($invr_tabl == "data")
{
if ($ns < 2)
{
$domn_array[$invr_tabl."@".$chbt_rchs]=$domn_array[$invr_tabl."@".$chbt_rchs]+1;
// echo "
".$chbt_lnks." | ".$chbt_url." | | ".$chbt_corp. " | | ". $chbt_rchs." ".$lvgpt_indx." |
";
$ns=$ns+1;
}
}
if ($invr_tabl == "sgmt")
{
if ($nr< 2)
{
$domn_array[$invr_tabl."@".$chbt_rchs]=$domn_array[$invr_tabl."@".$chbt_rchs]+1;
// echo "
".$chbt_lnks." | ".$chbt_url." | | ".$chbt_corp. " | | ". $chbt_rchs." ".$lvgpt_indx." |
";
$nr=$nr+1;
}
}
if ($invr_tabl == "lpzg")
{
if ($nv < 2)
{
$domn_array[$invr_tabl."@".$chbt_lnks]=$domn_array[$invr_tabl."@".$chbt_lnks]+1;
// echo "
".$chbt_lnks." | ".$chbt_url." | | ".$chbt_corp. " | | ". $chbt_rchs." ".$lvgpt_indx." |
";
$nv=$nv+1;
}
}
if (substr($chbt_lnks,0,6)== "./data")
{
$domn_array[$invr_tabl."@".$chbt_rchs]=$domn_array[$invr_tabl."@".$chbt_rchs]+1;
$file_dtls=explode("/",$chbt_lnks);
// print_r($file_dtls);
$file_chbt=$file_dtls[2];
$lchbt_lnks="".$file_chbt."";
$luttr_srch="";
// $lvgpt_indx="";
// echo "
".$lchbt_lnks." | ".$chbt_url." | | ".$chbt_corp. " | | ". $chbt_rchs." |
";
echo "
".$lchbt_lnks." | ".$luttr_srch." | | ". $chbt_rchs." |
";
}
}
}
}
}
// print_r($domn_array);
$cn=0;
foreach($domn_array as $domn_key => $domn_val)
{
$domn_itms=explode("@",$domn_key);
$domn_text=$domn_itms[1];
if ($cn < 24)
{
// echo "
".$domn_text;
if (strlen($invr_lgrm) < 64 and $rrelt != $domn_text)
{
$sim = similar_text($invr_lgrm, $domn_text, $perc);
if ($perc > 0)
{
$domn_perc=round($perc, 2);
$perc_array[$domn_text]=$perc;
// echo "
".$domn_text." | ".$domn_perc." |
";
$rrelt=$domn_text;
}
}
$cn=$cn+1;
}
}
arsort($perc_array);
// print_r($perc_array);
foreach($perc_array as $perc_key => $perc_val)
{
// echo "
".$perc_val."% ".$perc_key;
?>
echo " ".$perc_key;
?>
exit;
}
echo "
";
//print_r($chbt_array);
arsort($chbt_array);
$ca=0;
foreach($chbt_array as $chbt_key => $chbt_val)
{
$ca=$ca+1;
if ($ca < 5)
{
$key_dtls=explode("!!",$chbt_key);
$key_corp=$key_dtls[0];
$key_text=$key_dtls[1];
$lchbt_key="".$key_corp."";
echo "
".$lchbt_key;
}
}
?>